home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / intrfc61.arc / HEAD.PAS < prev    next >
Pascal/Delphi Source File  |  1991-03-28  |  3KB  |  84 lines

  1. unit head;
  2. { Header declarations and dumper }
  3. interface
  4.  
  5. uses globals,util,dump;
  6.  
  7. type
  8.   unit_flags = set of (ieee_reals,overlays,f4,f8,f16,f32,f64,f128);
  9.   header_ptr = ^header_rec;
  10.   header_rec = record
  11.     file_id: array[0..3] of char; { 0-3 }
  12.     i4,                           { 4-5 }
  13.     i6,                           { 6-7 }
  14.     ofs_this_unit,                { 8-9 }
  15.     ofs_hashtable,                { A-B }
  16.     ofs_entry_pts,                { C-D }
  17.     ofs_code_blocks,              { E-F }
  18.     ofs_const_blocks,             {10-11}
  19.     ofs_var_blocks,               {12-13}
  20.     ofs_mystery,                  {14-15}
  21.     ofs_unit_list,                {16-17}
  22.     ofs_src_name,                 {18-19}
  23.     ofs_line_lengths,             {1A-1B}
  24.     sym_size,                     {1C-1D}
  25.     code_size,                    {1E-1F}
  26.     const_size,                   {20-21}
  27.     reloc_size,                   {22-23}
  28.     vmt_size,                     {24-25}
  29.     var_size,                     {26-27}
  30.     ofs_full_hash: word;          {28-29}
  31.     flags : unit_flags;           {2A}
  32.     other : array[$2b..$3F] of byte; {2b-3F}
  33.   end;
  34.  
  35. var
  36.   header : ^header_rec;
  37.  
  38. procedure print_header;
  39.  
  40. implementation
  41.  
  42. procedure print_header;
  43. var
  44.   i:integer;
  45. begin
  46.   with header^ do
  47.   begin
  48.     writeln('file_id:':20,file_id);
  49.     writeln('i4:':20,hexword2(i4));
  50.     writeln('i6:':20,hexword2(i6));
  51.     writeln('ofs_this_unit:':20,hexword2(ofs_this_unit));
  52.     writeln('ofs_hashtable:':20,hexword2(ofs_hashtable));
  53.     writeln('ofs_entry_pts:':20,hexword2(ofs_entry_pts));
  54.     writeln('ofs_code_blocks:':20,hexword2(ofs_code_blocks));
  55.     writeln('ofs_const_blocks:':20,hexword2(ofs_const_blocks));
  56.     writeln('ofs_var_blocks:':20,hexword2(ofs_var_blocks));
  57.     writeln('ofs_mystery:':20,hexword2(ofs_mystery));
  58.     writeln('ofs_unit_list:':20,hexword2(ofs_unit_list));
  59.     writeln('ofs_src_name:':20,hexword2(ofs_src_name));
  60.     writeln('ofs_line_lengths:':20,hexword2(ofs_line_lengths));
  61.     writeln('sym_size:':20,hexword2(sym_size));
  62.     writeln('code_size:':20,hexword2(code_size));
  63.     writeln('const_size:':20,hexword2(const_size));
  64.     writeln('reloc_size:':20,hexword2(reloc_size));
  65.     writeln('vmt_size:':20,hexword2(vmt_size));
  66.     writeln('var_size:':20,hexword2(var_size));
  67.     writeln('ofs_full_hash:':20,hexword2(ofs_full_hash));
  68.     write('flags:':20);
  69.     if ieee_reals in flags then
  70.       write('N+':4);
  71.     if overlays in flags then
  72.       write('O+':4);
  73.     if flags - [ieee_reals,overlays] <> [] then
  74.       write('unknown flags ',hexbyte(byte(flags)));
  75.     writeln;
  76.  
  77.     writeln('Other:');
  78.     dumpbytes(header^,$2b,$3f-$2a);
  79.     writeln;
  80.   end;
  81. end;
  82.  
  83. end.
  84.